﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter1.Section5
{
    public class Example06
    {
        public Example06()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
            double[,] x = { { 1.0 }, { 2.0 }, { 1.0 }, { 3.0 } };
            V.Matrix A = new V.Matrix(x);

            double[,] y = { { 2.0, 2.0, 1.0, 2.0 } };
            V.Matrix B = new V.Matrix(y);

            V.Matrix C = A * B;

            result += C[0, 0].ToString() + "   " + C[0, 1].ToString() + "   " + C[0, 2].ToString() + "   " + C[0, 3].ToString() + "\r\n";
            result += C[1, 0].ToString() + "   " + C[1, 1].ToString() + "   " + C[1, 2].ToString() + "   " + C[1, 3].ToString() + "\r\n";
            result += C[2, 0].ToString() + "   " + C[2, 1].ToString() + "   " + C[2, 2].ToString() + "   " + C[2, 3].ToString() + "\r\n";
            result += C[3, 0].ToString() + "   " + C[3, 1].ToString() + "   " + C[3, 2].ToString() + "   " + C[3, 3].ToString() + "\r\n";
         
            V.Matrix D = B * A;

            result += D[0, 0].ToString();       
        }
    }
}

/*
2   2   1   2
4   4   2   4
2   2   1   2
6   6   3   6
13 
*/  
